﻿using Expect.Core.Interfaces;

namespace Expect.Core.BaseClasses
{
    /// <summary>
    /// Manage specification execution
    /// </summary>
    public class DefaultSpecificationExecution
    {
        /// <summary>
        /// Start the execution
        /// </summary>
        public IExecutionContext Run(object container, SpecificationDefinition currentSpecification)
        {
            IExecutionContext res = new DefaultExecutionContext();
            currentSpecification.Context = res;
            res.Container = container;
            currentSpecification.Run();
            return res;
        }
    }
}
